import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/application/special_operation/special_home_page/general_view_all_page/general_view_all_view.dart';
import 'package:enterprise_v6_app/app/modules/application/special_operation/special_home_page/special_home_controller.dart';
import 'package:enterprise_v6_app/app/modules/application/special_operation/special_home_page/special_personal_data_page/special_personal_data_view.dart';

/// 安全生产首页
class SpecialHomePage extends StatelessWidget {
  SpecialHomePage({super.key});

  final controller = Get.put(SpecialHomeController());

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
        top: 12.w,
        left: 14.w,
        right: 14.w,
      ),
      color: AppColors.bg_color_grey,
      child: DefaultTabController(
        length: 2,
        initialIndex: controller.initPage,
        child: Column(
          children: [
            Container(
              padding: EdgeInsets.symmetric(horizontal: 30.w),
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(8),
              ),
              height: 54.w,
              child: TabBar(
                enableFeedback: false,
                tabs: const [
                  Tab(text: '总览'),
                  Tab(text: '个人数据'),
                ],
                dividerColor: Colors.transparent,
                labelPadding: EdgeInsets.only(bottom: 10.w),
                labelStyle: TextStyle(
                  fontSize: 16.sp,
                  fontWeight: FontWeight.w500,
                ),
                unselectedLabelStyle: TextStyle(
                  fontSize: 16.sp,
                  fontWeight: FontWeight.w500,
                ),
                labelColor: Colors.black,
                unselectedLabelColor: const Color(0xffA0A7B5),
                indicatorPadding: EdgeInsets.only(top: 36.w, bottom: 10.w),
                indicator: const BoxDecoration(
                  image: DecorationImage(
                    image: AssetImage(
                      AppImages.icon_app_work_plan,
                    ),
                  ),
                ),
              ),
            ),
            Expanded(
              child: Container(
                color: const Color(0xffF5F5F6),
                child: TabBarView(
                  children: [
                    GeneralViewAllPage(),
                    SpecialPersonalDataPage(),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
